var rootUrl = '/ws/';
$(document).ready(function() {
	$.post(rootUrl+"index.php?g=mobile&m=login&a=isLogin","",function(res){
		wx.config({
		    debug: false, 
		    appId: res.jsdk.appId,
			timestamp: res.jsdk.timestamp,
			nonceStr: res.jsdk.nonceStr,
			signature: res.jsdk.signature,
		    jsApiList: [
		      // 所有要调用的 API 都要加到这个列表中
		      'onMenuShareTimeline',
		      'onMenuShareAppMessage'
		    ]
		});
	},"json");
	
	$('a[href^="#"]').on('click',function (e) {
	    e.preventDefault();
	    var target = this.hash,
	    $target = $(target);
	    $('html, body').stop().animate({
	        'scrollTop': $target.offset().top
	    },800, 'swing', function () {
	        window.location.hash = target;
	    });
	});
	
})
wx.ready(function () {
	wx.onMenuShareTimeline({
	    title: '广东实验中学首届青春诗会',
	     link:'http://g4.airefp.com/ws/Html/School/index.html',
	     imgUrl: 'http://g4.airefp.com/ws/Html/School/img/share.png',
	      trigger: function (res) {
	       
	      },
	      success: function (res) {
	    	 
	      },
	      cancel: function (res) {
	       
	      },
	      fail: function (res) {
	      }
    });
    
	wx.onMenuShareAppMessage({
	    title: '广东实验中学首届青春诗会',
	    desc: '广东实验中学首届青春诗会 15号晚七点半 聆听我们的时代',
	    link:'http://g4.airefp.com/ws/Html/School/index.html',
	    imgUrl: 'http://g4.airefp.com/ws/Html/School/img/share.png',
	    success: function () { 
	    	
	    },
	    cancel: function () { 
	        // 用户取消分享后执行的回调函数
	    }
	});

});